//
//  FileHandler.m
//  YingKeZhuXiao
//
//  Created by lina on 16/6/30.
//  Copyright © 2016年 admin. All rights reserved.
//

#import "FileHandler.h"

@implementation FileHandler

+ (FileHandler *)shareInstance;
{
    static FileHandler * handler = nil;
    static dispatch_once_t onceToken;
    
    dispatch_once(&onceToken, ^{
        handler = [[FileHandler alloc] init];
    });
    
    return handler;
}

+ (NSString *)bundlePath:(NSString *)fileName
{
    return [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:fileName];
}

#pragma mark - 用户头像文件本地路径
+ (NSString *)UserHeaderPath:(NSString *)fileName
{
    NSString *path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"UserImage"];
    if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
        [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
    }
    if ([fileName isEqualToString:@""]) {
        return path;
    }else{
        return [path  stringByAppendingPathComponent:fileName];
    }
}



@end
